<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"          			
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <ui:composition template="TaskProLayout.xhtml">
        <ui:define name="content"> 
            <h:form>   
                <div class="Post">
                    <h:panelGrid columns="2" styleClass="gridCenter">
                        <h:outputText value="Group code: " />
                        <p:inputText id="paralelkaCode" value="#{groupBean.code}"></p:inputText> 
                        <h:outputText value="Start time: " />
                        <p:calendar value="#{groupBean.startTime}" pattern="HH:mm" timeOnly="true" />   
                        <h:outputText value="Stop time: " />
                        <p:calendar value="#{groupBean.stopTime}" pattern="HH:mm" timeOnly="true" />   
                        <h:outputText value="Day of teach " />
                        <p:inputText  value="#{groupBean.dayOfTeach}"></p:inputText> 

                    </h:panelGrid>
                </div>
                <div class="Post"> 
                    <p:dataTable 
                        var="subject" value="#{groupBean.subjects}" paginator="true"   
                        selection="#{groupBean.subjectChoosen}"
                        rowKey="#{subject.code}" paginatorAlwaysVisible="false" rows="10"
                        >  
                        <f:facet name="header">  
                            <h:outputText value="Choose subject to group" />
                        </f:facet>  
                        <p:column selectionMode="single" />  
                        <p:column headerText="Code" >  
                            <h:outputText value="#{subject.code}" />  
                        </p:column>  
                        <p:column headerText="Description">  
                            <h:outputText value="#{subject.description}" />  
                        </p:column>  
                    </p:dataTable>  
                </div>
                <div class="Post">
                    <p:dataTable var="student" value="#{groupBean.students}" paginator="true" paginatorAlwaysVisible="false"  
                                 selection="#{groupBean.studentsChoosen}" rows="20"
                                 rowKey="#{student.login}">  
                        <f:facet name="header">  
                            <h:outputText value="Choose student to group" />
                        </f:facet>  
                        <p:column selectionMode="multiple" />  
                        <p:column headerText="Login">  
                            <h:outputText value="#{student.login}" />  
                        </p:column>  
                        <p:column headerText="Name">  
                            <h:outputText value="#{student.name}" />  
                        </p:column>  
                        <p:column headerText="Surname">  
                            <h:outputText value="#{student.surname}" />  
                        </p:column>  
                        <p:column headerText="Email">  
                            <h:outputText value="#{student.email}" />  
                        </p:column>  
                    </p:dataTable> 
                </div>
                <div class="Post">
                    <p:dataTable var="kantor" value="#{groupBean.kantors}" paginator="true"  
                                 selection="#{groupBean.selectedKantor}" paginatorAlwaysVisible="false"
                                 rowKey="#{kantor.login}" rows="20">  
                        <f:facet name="header">  
                            <h:outputText value="Choose kantor to group" />
                        </f:facet>  
                        <p:column selectionMode="single" />  
                        <p:column headerText="Login">  
                            <h:outputText value="#{kantor.login}" />  
                        </p:column>  
                        <p:column headerText="Name">  
                            <h:outputText value="#{kantor.name}" />  
                        </p:column>  
                        <p:column headerText="Surname">  
                            <h:outputText value="#{kantor.surname}" />  
                        </p:column>  
                        <p:column headerText="Email">  
                            <h:outputText value="#{kantor.email}" />  
                        </p:column>  
                    </p:dataTable> 
                </div>
                <div class="Post">
                    <p:commandButton value="Create group" action="#{groupBean.createParallel()}" ajax="false"></p:commandButton>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</html>